﻿using System;

namespace CommonEngine.Resource
{
    /// <summary>
    /// 资源信息接口
    /// </summary>
    public interface IResourceType
    {
        Guid Id { get; }
        /// <summary>
        /// 资源类名(切面类)
        /// </summary>
        string Name { get; }
        /// <summary>
        /// 资源项显示名称（中文）
        /// </summary>
        string DisplayName { get; }
        /// <summary>
        /// 是否具有数据权限
        /// </summary>
        bool HasDataPermisson { get; }
    }

    //对于资源的初始化方式有多种，所以将基础结构抽象出来，不妨碍业务场景的调用
    public interface IResourceOperation
    {
        /// <summary>
        /// OP指示器枚举值
        /// </summary>
        int Indicator { get; }
        string DisplayName { get; }
    }

    /// <summary>
    /// 资源配置功能OP信息
    /// </summary>
    public class ResourceTypeOperation : IResourceOperation
    {
        public const int Assigned = 8388608;    //1073741824;
        /// <summary>
        /// 构造
        /// </summary>
        public ResourceTypeOperation(int indicator, string displayName)
        {
            this.Indicator = indicator;
            this.DisplayName = displayName;
        }
        public int Indicator { get; private set; }
        public string DisplayName { get; private set; }
    }
}
